package com.hmall.user.controller.inner;

import com.hmall.user.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @author Zhy
 * @version 1.0
 * @date 2025-03-20 20:12
 */
@Api(tags = "用户相关接口")
@RestController
@RequestMapping("/inner/users")
@RequiredArgsConstructor
public class UserInnerController {

	private final IUserService userService;

	@ApiOperation("扣减余额")
	@ApiImplicitParams(
		{@ApiImplicitParam(name = "pw", value = "支付密码"), @ApiImplicitParam(name = "amount", value = "支付金额")})
	@PutMapping("/money/deduct")
	public void deductMoney(@RequestParam("pw") String pw, @RequestParam("amount") Integer amount, @RequestParam("userId") Long userId) {
		userService.deductMoney(pw, amount, userId);
	}

}

